home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / BlobMgr / Library Folder / HideShow.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-21  |  1.1 KB  |  68 lines  |  [TEXT/KAHL]

  1. /*
  2.  * HideShow.c - Blob hide and show operations
  3.  *
  4.  * 23 Dec 93
  5.  * - Fix bug in HideBlob with filling regions with port->bkPat.  That
  6.  * fails if port is a CGrafPort.  Just EraseRect() instead, which knows
  7.  * how to do the correct thing.
  8.  */
  9.  
  10. # include    "BlobMgr.h"
  11.  
  12.  
  13. /*
  14.  * If blob not already hidden, hide it by filling both the bounds
  15.  * box of each region with current grafport's background pattern,
  16.  * and accumulate the boxes into the update region.
  17.  */
  18.  
  19. pascal void
  20. HideBlob (BlobHandle b)
  21. {
  22. GrafPtr    thePort;
  23. Rect    r;
  24.  
  25.     if (BlobEnabled (b))            /* ignore if already disabled */
  26.     {
  27.         DisableBlob (b);
  28.         GetPort (&thePort);
  29.  
  30.         r = BStatBox (b);
  31.         EraseRect (&r);
  32.         InvalRect (&r);
  33.  
  34.         r = BDragBox (b);
  35.         EraseRect (&r);
  36.         InvalRect (&r);
  37.     }
  38. }
  39.  
  40.  
  41. pascal void
  42. HideBlobSet (BlobSetHandle bSet)
  43. {
  44.     BlobLoopProc1 (&HideBlob, bSet);
  45. }
  46.  
  47.  
  48. /*
  49.  * If blob is not already enabled, show it.
  50.  */
  51.  
  52. pascal void
  53. ShowBlob (BlobHandle b)
  54. {
  55.     if (BlobEnabled (b) == false)        /* ignore if already enabled */
  56.     {
  57.         EnableBlob (b);
  58.         DrawBlob (b, inFullBlob);
  59.     }
  60. }
  61.  
  62.  
  63. pascal void
  64. ShowBlobSet (BlobSetHandle bSet)
  65. {
  66.     BlobLoopProc1 (&ShowBlob, bSet);
  67. }
  68.